package com.project.springboot.hashset;

import java.math.BigDecimal;
import java.util.Objects;

/**
 * description: 书籍
 * @author 朱正磊
 * @date 2024-04-12 13:34:17
 */
public class Book1 {

    private String name;

    private String author;

    private Integer pageNum;

    private BigDecimal price;

    public Book1() {

    }

    public Book1(String name, String author, Integer pageNum, BigDecimal price) {
        this.name = name;
        this.author = author;
        this.pageNum = pageNum;
        this.price = price;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getAuthor() {
        return author;
    }

    public void setAuthor(String author) {
        this.author = author;
    }

    public Integer getPageNum() {
        return pageNum;
    }

    public void setPageNum(Integer pageNum) {
        this.pageNum = pageNum;
    }

    public BigDecimal getPrice() {
        return price;
    }

    public void setPrice(BigDecimal price) {
        this.price = price;
    }

    @Override
    public boolean equals(Object obj) {
        if (this == obj) return true;
        if (obj == null || getClass() != obj.getClass()) return false;
        Book1 book1 = (Book1) obj;
        return Objects.equals(name, book1.name) && Objects.equals(author, book1.author);
    }

    @Override
    public int hashCode() {
        return Objects.hash(name, author);
    }

    @Override
    public String toString() {
        return "Book1{" +
                "name='" + name + '\'' +
                ", author='" + author + '\'' +
                ", pageNum=" + pageNum +
                ", price=" + price +
                '}';
    }

}
